package com.sky.controller.user;


import com.sky.dto.UserLoginDTO;

import com.sky.result.Result;
import com.sky.service.user.UserLoginService;
import com.sky.vo.UserLoginVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;



@RestController
@Slf4j
@Api(tags = "what用户登录")
public class UserLoginController {

    @Autowired
    private UserLoginService userLoginService;


    @ApiOperation("wechat登录接口")
    @PostMapping("/user/user/login")
    public Result login(@RequestBody UserLoginDTO dto) {

        dto.setLocation("104.077774,30.655544");
        log.info("用户请求登录{}",dto);

        UserLoginVO login = userLoginService.login(dto);
        return Result.success(login);
    }

}
